package com.sky.mapper;

import com.sky.entity.User;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper

public interface UserMapper {
    /**
     * 微信登录
     * @param openid
     * @return
     */
    @ApiOperation("微信登录")
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);


    void insert(User user);


    @Select("select * from user where id = #{id}")
    User getById(Long id);

    /**
     * 根据日期动态获取用户数据
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
